package cn.broadsense.biz.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.broadsense.biz.domain.Channel3dData;
import cn.broadsense.biz.service.Channel3dDataService;
import cn.broadsense.biz.mapper.Channel3dDataMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author pengxin
 * @description 针对表【t_channel_3d_data(点位三维数据表)】的数据库操作Service实现
 * @createDate 2023-09-12 10:55:35
 */
@Service
public class Channel3dDataServiceImpl extends ServiceImpl<Channel3dDataMapper, Channel3dData>
        implements Channel3dDataService {


    @Override
    public Channel3dData getByChannelId(Long channelId) {
        LambdaQueryWrapper<Channel3dData> query = new LambdaQueryWrapper<>();
        query.eq(Channel3dData::getChannelId, channelId);
        query.last("limit 1");
        Channel3dData channel3dData = this.getOne(query);
        return channel3dData;
    }

    @Override
    public void batchInsert(List<Channel3dData> addList) {
        this.baseMapper.batchInsert(addList);
    }

    @Override
    public void update(Channel3dData channel3dData) {
        this.baseMapper.updateById(channel3dData);
    }
}




